I'm trying to create a Readme-like pop-up window that contains a richText box. The problem is that I'm very new to using the RichText box in DXL. I want to make the first line in the text box centered and bolded with the rest of the text being left-aligned in regular font. Here is the start of my showReadMe function:
void showReadMe() {
DB helpBox = create "Help";
string sHelp = "";
sHelp = "\\b Title text\n\n";
sHelp = sHelp "First paragraph in normal 'un-bolded' text.\n";
sHelp = sHelp "\tAnother descriptive paragraph for read me file\n";
sHelp = sHelp "\tFor more information email Chris at cchris@abc.com\n";
helpText = richText(helpBox, "", sHelp, 800, 600, true);
show helpBox;
}
As a little background, I tried using a canvas, but couldn't get newlines or tabs to work correctly, so I am now trying to use a rich textbox to display the text, but the Title text isn't displaying as bold as I thought it would.
void showReadMe(DBE xCanvas) {
string sTitle = "SCP Tool Readme";
font(xCanvas, 1, HeadingsFont);
setFontSettings(8, 5, 5, "Times", true, false);
draw(xCanvas, 250, 25, sTitle);
setFontSettings(2, TextFont, 10, "Times", false, false);
string sContent = "1.0 - Original first version used for testing\n";
sContent = sContent "\t1.1 - Added styles for each heading level.\n"
font(xCanvas, 3, TextFont);
draw(xCanvas, 20, 50, sContent);
}
DB readMe = create("Readme", styleCentered|styleFixed);
DBE helpCnvs = canvas(readMe, 800, 600, showReadMe);
show readMe;
Chris chrscote - Wed May 10 09:20:26 EDT 2017 |
Re: Trouble using RichText in richText box
For bold text you need "{\\b your bold text}" |
Re: Trouble using RichText in richText box Antonio__Norkus - Wed May 10 10:47:15 EDT 2017
For bold text you need "{\\b your bold text}" Thank you Antonio. That worked great. On a related note, is it possible to add RichText to a label? Also, how would I center the text that's bolded, if possible?
Chris |
Re: Trouble using RichText in richText box A label can't display rich text. I don't think that DXL supports centering of rich text either. If you paste some centered text from MS-Word, it becomes left-aligned after the change is committed. |